package com.jiuwan.gamepass.controller;

import com.jiuwan.gamepass.dto.appJson.FeedBackJson;
import com.jiuwan.gamepass.service.impl.FeedBackServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @version 1.0
 * 功能目的描述 ：用于         ========>>>>>>>>>>>
 * @author： pang-yun
 * @date： 2021-06-10 09:47
 */
@Controller
@RequestMapping("feedback")
public class FeedBackController {

    @Autowired
    private FeedBackServiceImpl feedBackService;

    @RequestMapping("add")
    @ResponseBody
    public FeedBackJson addFeedBack(String english, String translate, String appID) {
        FeedBackJson feedBackJson = feedBackService.uploadWord(english, translate, appID);
        return feedBackJson;
    }


    @RequestMapping("select")
    @ResponseBody
    public FeedBackJson selectFeedBack(String appID) {
        FeedBackJson feedBackJson = feedBackService.selectByAppID(appID);
        return feedBackJson;
    }

    @RequestMapping("update")
    @ResponseBody
    public FeedBackJson updateFeedBack(String english, String translate, String appID) {
        FeedBackJson feedBackJson = feedBackService.updateByAppID(english, translate, appID);
        return feedBackJson;
    }


    @RequestMapping("delete")
    @ResponseBody
    public FeedBackJson updateFeedBack(String appID) {
        FeedBackJson feedBackJson = feedBackService.deleteByAppID(appID);
        return feedBackJson;
    }
}
